package test.my.com.myapplicationtest.holder_dapter;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import test.my.com.myapplicationtest.R;

/**
 * Author : Cooper
 * Time : 2016/5/12  11:54
 * Description :
 */
public class HolderAdapterActivity extends Activity {

    private ListView mHolderAdapter_lv;
    private TestHolderAdapter mTestHolderAdapter;
    private List<Person> mPersonList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.aty_holder_adapter_layout);
        mHolderAdapter_lv = (ListView) findViewById(R.id.mHolderAdapter_lv);
        mPersonList = new ArrayList<>();
        Person person1 = new Person("老李","男","45岁");
        Person person2 = new Person("老是否","男","45岁");
        Person person3 = new Person("老我","男","45岁");
        Person person4 = new Person("老他","男","45岁");
        Person person5 = new Person("老一","女","45岁");
        Person person6 = new Person("老u","男","45岁");
        Person person7 = new Person("老额","女","45岁");
        Person person8 = new Person("老人","男","45岁");
        mPersonList.add(person1);
        mPersonList.add(person2);
        mPersonList.add(person3);
        mPersonList.add(person4);
        mPersonList.add(person5);
        mPersonList.add(person6);
        mPersonList.add(person7);
        mPersonList.add(person8);
        mTestHolderAdapter = new TestHolderAdapter(this,mPersonList);
        mHolderAdapter_lv.setAdapter(mTestHolderAdapter);

    }
}
